//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Spreadsheet.Expressions;

namespace OpenLS.Spreadsheet
{
    class SetCellExpressionUndoUnit : CellUndoUnit
    {
        public SetCellExpressionUndoUnit(Cell target)
            : base(target)
        {
            expression = target.Expression;
            Value = target.Value;
        }
        readonly Expression expression;
        readonly object Value;
        #region IUndoUnit Members

        public override void Do()
        {
            _target.SetExpression(expression);
            _target.SetValue(Value);
        }

        #endregion
    }
}
